
#ifndef _APDU_LIB_KEY_MGR_H_
#define _APDU_LIB_KEY_MGR_H_

#include "../apdu.def/apdu_datatypes.h"

#ifdef __cplusplus
extern "C" {
#endif
	
	int app_export_public_key(HANDLE devHandle, int app_id, int container_id, int key_type,		
							unsigned char * pub_key_blob, int *key_blob_len);

	int app_import_session_key( HANDLE devHandle, int app_id, int container_id, int key_spec, 
							unsigned long alg_id, unsigned char * wraped_data, unsigned long wraped_len, int * session_key_id );
	
	int app_destroy_session_key(HANDLE devHandle, int app_id, int container_id, int session_key_id);
	
	int app_gen_container_session_key( HANDLE devHandle, int app_id, int container_id, 
							unsigned long alg_id, int * session_key_id );

	int app_set_container_session_key( HANDLE devHandle, int app_id, int container_id, 
							unsigned long alg_id, unsigned char * key_value, int len, int * session_key_id );

	int app_set_session_key_from_file(HANDLE devHandle, int app_id, int container_id, 
							unsigned long alg_id, char * file_name, int offset,int * session_key_id );


#ifdef __cplusplus
}
#endif

#endif
